package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.RoleType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2016/12/12.
 *
 */
@Entity
@Table(name = "sys_role")
@DynamicInsert
@DynamicUpdate
public class SysRole extends IDEntityMall {

    @Column(columnDefinition = "varchar(50) comment '角色名称'")
    public String name;
    @Column(columnDefinition = "varchar(50) comment '类型 DEFAULT(\"系统默认\"), CUSTOMER(\"自定义\")'")
    @Enumerated(EnumType.STRING)
    public RoleType type;
    @Column(columnDefinition = "bigint(20) comment '平台ID 系统角色 mallId = 0'")
    public Long mallId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getMallId() {
        return mallId;
    }

    public RoleType getType() {
        return type;
    }

    public void setType(RoleType type) {
        this.type = type;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    @Override
    public String toString() {
        return "SysRole{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", type=" + type +
                ", dateCreated=" + dateCreated +
                ", mallId=" + mallId +
                ", lastUpdated=" + lastUpdated +
                ", isDelete=" + isDelete +
                ", version=" + version +
                '}';
    }
}
